<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>客户管理 leads客户</title>
<link href="${rc.contextPath}/common/css/common/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${rc.contextPath}/common/js/thickbox/jquery.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/config.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/thickbox/thickbox.js"></script>
<link rel="stylesheet" href="${rc.contextPath}/common/js/zTree/css/demo.css" type="text/css"/>
<link rel="stylesheet" href="${rc.contextPath}/common/js/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css"/>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery.ztree.excheck-3.5.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery.ztree.exedit-3.5.js"></script>

<link rel="stylesheet" href="${rc.contextPath}/common/css/authority/department.css"  rel="stylesheet" type="text/css"/>
<script type="text/javascript">
var zNodes=$deptJson;
</script>
<script type="text/javascript" src="${rc.contextPath}/common/js/main.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/authority/department.js"></script>
</head>
<body>
<input type="hidden" id="rootPath" value="${rc.contextPath}"/>
<div class="main">
	<div class="position">
		<div class="p_left">当前位置：权限管理 &lt; 部门管理 </div>
	    <div class="p_right">
	      <dl><dt>姓名：</dt><dd>${currentUser.ename}</dd></dl>
	      <dl><dt>登录时间：</dt><dd><span id="nowDate"></span></dd></dl>
	    </div>
	</div>
	<div class="content_wrap">
		<div class="zTreeDemoBackground left">
			<ul id="treeDemo" class="ztree"></ul>
		</div>
		<div class="right">
			<ul class="info">
				<li class="title">
					<ul class="list">
					<li>
						#if($shiro.hasPermission("查看部门"))
							&nbsp;&nbsp;&nbsp;&nbsp;[ <a id="query" href="#" title="查看节点">查看部门</a> ]
						#end
						#if($shiro.hasPermission("添加部门"))
							&nbsp;&nbsp;&nbsp;&nbsp;[ <a id="addParent" href="#" title="增加父节点" onclick="return false;">添加部门</a> ]
						#end
						#if($shiro.hasPermission("修改部门"))
							&nbsp;&nbsp;&nbsp;&nbsp;[ <a id="edit" href="#" title="编辑名称" onclick="return false;">修改部门</a> ]
						#end
						#if($shiro.hasPermission("删除部门"))
							&nbsp;&nbsp;&nbsp;&nbsp;[ <a id="remove" href="#" title="删除节点" onclick="return false;">删除部门</a> ]
						#end
					</li>
					
					</ul>
					<div class="btnOper2 btn_inline"><a href="${rc.contextPath}/authority/department/sysnDeptRelation" class="btn2"><span>同步部门关系</span></a>&nbsp;&nbsp;&nbsp;</div>
				</li>
			</ul>
		</div>
	</div>
	<div id="addDept" class="department">
	<form id="deptForm" method="post"> 
		<input name="id" id="deptId"  type="hidden"/>
		<input name="areaStr" id="areaStr"  type="hidden"/>
  		<input name="productStr" id="productStr"  type="hidden"/>
  		<input name="companyStr" id="companyStr"  type="hidden"/>
  		<input id="isCanUseTheDeptName" value="" type="hidden"/>
		<div class="title"></div>
		<div style="margin-left: 20px;">添加部门</div>
		<div style="margin-left: 20px;">
			<div style="width:100%;overflow:hidden;">
				<ul>
					<li style="float:left; width:300px; text-align:left; ">
						部门名称:
						<input id="dname" maxlength="20" name="dname" />
						<label id="checkDeptNameResult" style="color: red;margin-left:10px;"></label>
					</li>
					<li style="float:left; width:300px; text-align:left; ">
						所属部门:
						<input id="parentId" name="parentId" style="width: 120px;" type="hidden" />
						<input id="tempParentId" style="width: 120px;" type="text" readonly="readonly"></input>
						<a href="javaScript:queryDeptTree();"><img src="${rc.contextPath}/common/images/search.jpg" alt="" width="15px;" height="15px;" /></a>
					</li>
				</ul>
			</div>
			<div style="width:100%;overflow:hidden;">
				<div style="width:34%; float:left;">负责区域:</div>	
				<div style="width:33%; float:left;">负责产品:</div>	
				<div style="width:30%; float:left;">所属分公司:</div>	
			</div>
			<div style="width:100%;overflow:hidden;">
				<table style="width:100%;">
					<tr>
						<td style="width:11%;">未选中区域：</td>
						<td style="width:4%;">&nbsp;</td>
						<td style="width:11%;">选中区域：</td>
						<td style="width:5%;">&nbsp;</td>
						<td style="width:11%;">未选中产品：</td>
						<td style="width:4%;">&nbsp;</td>
						<td style="width:11%;">选中产品:</td>
						<td style="width:5%;">&nbsp;</td>
						<td style="width:11%;">未选中分公司:</td>
						<td style="width:4%;">&nbsp;</td>
						<td>选中分公司:</td>
					</tr>
					<tr>
						<td>
							<select id="parentArea" onchange="changeClassB(this)"  style="width: 120px;">
					  		<option value="">-----请选择省份------</option>
				  			#foreach($area in $parentAreaList)
				  				<option value="$area.areaID">$area.name</option>
				  			#end
				  	  		</select>
				  	 	</td>
						<td>&nbsp;</td>
						<td><input type="button" style="" onclick="getAllArea();"  value="添加所有区域"/></td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
						<td>&nbsp;</td>
					</tr>
					<tr>
						<td >
							<select id="allArea" multiple name="allArea" size="5" style="width: 120px;height: 200px;"></select>
				  	 	</td>
						<td style=" text-align:center;">
							<input type="button" value=">>" style="width: 35px;"  onclick="javascript:copyAreaToList('allArea','selectedArea')" />
							<br/>
							<input type="button" value="<<"  style="width: 35px;" onclick="javascript:copyAreaToList('selectedArea','allArea')"/>
						</td>
						<td>
							<select id="selectedArea" multiple name="selectedArea" size="5" style="width: 120px;height: 200px;"></select>
							<select id="hidedArea" style="display: none;"></select>
						</td>
						<td>&nbsp;</td>
						<td>
							<select id="allProduct" multiple name="allProduct" size="5" style="width: 120px;height: 200px;">
								#foreach( $product in $productList)  
									<option value="$product.productCode">$product.productName</option>
								#end
							</select>
						</td>
						<td style="text-align:center;">
							<input type="button" value=">>" onclick="javascript:copyProductToList('allProduct','selectedProduct')" style="width: 35px;" /><br />
							<input type="button" value="<<"  style="width: 35px;" onclick="javascript:copyProductToList('selectedProduct','allProduct')"/>
						</td>
						<td>
							<select id="selectedProduct" multiple name="selectedProduct" size="5" style="width: 120px;height: 200px;"></select>
						</td>
						<td>&nbsp;</td>
						<td>
							<select id="allCompany" multiple name="allCompany" size="5" style="width: 120px;height: 200px;">
								#foreach( $company in $companyList)
									<option value="$!company.id">$company.companyAbb</option> 
								#end
							</select>
						</td>
						<td style="text-align:center;">
							<input type="button" value=">>" onclick="javascript:copyCompanyToList('allCompany','selectedCompany')" style="width: 35px;" /><br />
							<input type="button" value="<<" onclick="javascript:copyCompanyToList('selectedCompany','allCompany')" style="width: 35px;"/></td>
						<td>
							<select id="selectedCompany" multiple name="selectedCompany" size="5" style="width: 120px;height: 200px;"></select>
						</td>
					</tr>
				</table>
			</div>
			<div style="width:100%;overflow:hidden; text-align:right; margin-top:15px;">
				<input id="addBtn" type="button" value="添加" style="margin-right: 10px;"/>
				<input id="updateBtn" style="display: none;margin-right: 10px;" type="button" value="修改" />
				<input id="addBtnCancel" type="button" value="取消" style="margin-right: 10px;"/>
				
			</div>
		</div>
	</form>
	</div>
	
	<div id="deptTree"  class="deptTree" style="width: 900px;height: 550px;display: none;">
		<div class="title"></div><br/>
		<div style="margin-left: 20px;">选择部门
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input id="deptTreeBtnCancel" type="button"  value="取消" style="float: right;margin-right: 10px;"/>
			<input id="queryDeptTreeBtnConfirm" type="button"  value="确定" style="float: right;margin-right: 10px;" />&nbsp;&nbsp;
		</div>
		<div style="margin-left: 20px;overflow-x: auto; overflow-y: auto;float: left;" class="zTreeDemoBackground left" >
			<ul id="deptTreeDemo" class="ztree"></ul>
		</div>
	</div>

</div>
</body>
</html>
